<%@ page  contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
 <script language="javascript">
 var factory=$("#factory").val();
   function clear_data_info()
   {
	   $.CurrentNavtab.find("#caijishijian,#caijishijianend").val("");
   }
   function dataExport()
   {
	  var caijishijian =  $.CurrentNavtab.find("#caijishijian").val();
	  var dateend = $.CurrentNavtab.find("#caijishijianend").val();
	   $.CurrentNavtab.find("#export_caijishijian").attr("value",caijishijian);
	   $.CurrentNavtab.find("#export_caijishijianend").attr("value",dateend);
	   $.CurrentNavtab.find("#exportData").submit();
   }
   function dataLine(e)
   {
	   try{
	   var caijishijian =  $.CurrentNavtab.find("#caijishijian").val();
		  var dateend = $.CurrentNavtab.find("#caijishijianend").val();
		   $.CurrentNavtab.find("#export_caijishijian").attr("value",caijishijian);
		   $.CurrentNavtab.find("#export_caijishijianend").attr("value",dateend);
		   $.CurrentNavtab.find("#exportData").attr;
		   var href="${pageContext.request.contextPath}/data/selectWtldDataLine.do?disijiid=${disijiid}&caijishijian=" + caijishijian;
		   href += "&caijishijianend=" + dateend+"&factory="+factory;		   
		   $(e).navtab({id:'dateline', url:href, title:'查看数据曲线图'});
	   }catch(ee){alert(ee.message);}
   }
 </script>
	<div class="bjui-pageContent tableContent">
	 <form id="exportData" name="exportData" method="post" action="${pageContext.request.contextPath}/data/selectExport.do">
	 <input type="hidden" name="disijiid" value="${disijiid}"/> 
	 <input type="hidden" name="caijishijian" id="export_caijishijian" value=""/>
	 <input type="hidden" name="flag" value="wtld">
	 <input type="hidden" name="caijishijianend" id="export_caijishijianend" value=""/>
	 </form>
	  <form id="pagerForm" data-toggle="ajaxsearch" action="${pageContext.request.contextPath}/data/selectWtldData.do" method="post">
        <div class="bjui-searchBar clearfix" style="padding:2px;">  
			<div class="search-group">     
			<input type="hidden" name="disijiid" value="${disijiid}"/>    
			<input type="hidden" name="pageSize" value="${pagePara.pageSize }"/>
			<input type="hidden" name="pageIndex" value="${pagePara.pageIndex }"/>
	        <label>查询开始时间：</label>
	        <input type="text" name="caijishijian" id="caijishijian" readonly value="<fmt:formatDate value='${caijishijian}' pattern='yyyy-MM-dd'/>" data-toggle="datepicker" data-rule="date"/>
	        <label>查询结束时间：</label>
	        <input type="text" name="caijishijianend" id="caijishijianend" readonly value="<fmt:formatDate value='${caijishijianend}' pattern='yyyy-MM-dd'/>" data-toggle="datepicker" data-rule="date"/>    
	        <button type="submit" class="btn-default" data-icon="refresh">搜索</button>
	        <button type="button" id="data_export" class="btn-default"  onclick="dataExport()">导出数据</button>
	        <button type="button" id="rtuEqui" class="btn-default" onclick="dataLine(this)">查看曲线图</button>
	        <button type="button" class="btn-default"  onclick="clear_data_info()">清空</button>
            </div>
        </div>
    </form>	
	    <table data-toggle="tablefixed" class="table table-bordered table-hover table-striped table-top center" data-width="100%">
	    	<thead>
				<tr>
					<th>设备名称</th>
					<th>记录时间</th>					
					<th>采集时间</th>
					<th>在线状态</th>	
					<th>设备状态</th>
					<th>数据有效性</th>
					<th>水位计读数(m)</th>				
				    <th>水温(℃)</th>
				    <th>电导率(μs/cm)</th>
				    <th>温度(℃)</th>
				    <th>电池电压</th>
				    <th>水位计状态</th>
				</tr>
	    	</thead>
	    	<tbody>
	    	<c:forEach var="usr" varStatus="status" items="${list}">
	    	<tr>
	    				<td>${usr.shebeimingcheng}</td>
						<td><fmt:formatDate value='${usr.jilushijian}' pattern='yyyy-MM-dd HH:mm:ss'/></td>
						<td><fmt:formatDate value='${usr.caijishijian}' pattern='yyyy-MM-dd HH:mm:ss'/></td>
						<td>${usr.zaixianstatus}</td>	
			    		<td>${usr.shebeistatus}</td>
						<td>${usr.shujuyouxiaoxing}</td>
						<td>${usr.shuiwei}</td>
						<td>${usr.shuiwen}</td>
						<td>${usr.diandaolv}</td>	
						<td>${usr.wendu}</td>
						<td>${usr.dianchidianya}</td>	
						<td>${usr.shuweijistatus}</td>						    		
	    	</tr>
	    	</c:forEach>
	    	</tbody>
	    </table>
	</div>
	<div class="bjui-pageFooter">
    <div class="pages">
        <span>每页&nbsp;</span>
        <div class="selectPagesize">
            <select data-toggle="selectpicker" data-toggle-change="changepagesize">
                <option value="5">5</option>
                <option value="30">30</option>
                <option value="60">60</option>
                <option value="100">100</option>
            </select>
        </div>
        <span>&nbsp;条，共 ${pagePara.total } 条</span>
    </div>
    <div class="pagination-box pull-left" data-toggle="pagination" data-total=" ${pagePara.total }" data-page-size=" ${pagePara.pageSize}" data-page-current="${pagePara.pageIndex}"></div>
</div>